<h4 class="h4">管理员列表</h4>
<table class="table table-bordered">
    <tr class="success ">
        <th width="10%">ID</th>
        <th width="20%">姓名</th>
        <th width="20%">操作</th>
    </tr>
    <?php
                    foreach ($rows as $value) {
                ?>
    <tr>
        <td><?=$value['id']?></td>
        <td><?=$value['number']?></td>
        <td><a class="btn btn-primary examination"  sid="<?=$value['id']?>">&nbsp;删除</a>
    </tr>
    <?php }?>
</table>
<script>
    $('.examination').on('click', function (e) {
        layer.confirm('真的删除该管理员吗？', function (index) {
            var ii = layer.load(1);
            $.ajax({
                type: 'GET',
                url: 'comm/deladmin.php?id=' + $(e.target).attr('sid'),
                dataType: 'json',
                success: function (msg) {
                    if (msg.code == 200) {
                        layer.close(index);
                        layer.msg('删除成功!', { icon: 1, time: 1000 });
                    } else {
                        layer.close(index);
                        layer.msg('程序异常!', { icon: 5, time: 1000 });
                    }
                    window.parent.location.reload(); //刷新父页面
                    layer.close(ii);
                },
                error: function (msg) {
                    layer.msg('程序异常!', { icon: 5, time: 1000 });
                    layer.close(index);
                }
            });
        });
    })

</script>